<?php
class Sections extends DatabaseTable {

    public function __construct($conn) {
        parent::__construct($conn);
    }

    protected function load(){
        $sections_table="sections_".$this->getLanguage()->getCode();
        $query=sprintf("SELECT * FROM 	%s",
            mysql_real_escape_string($sections_table));
	$result=mysql_query($query,$this->conn);
	if ($result){
            while ($row = mysql_fetch_assoc($result)) {
                $id=$row['id'];
                $name=$row['name'];
                $long_name=$row['long_name'];
                $section= new Section();
                $section->setId($id);
                $section->setName($name);
                $section->setLongName($long_name);
                $this->records[$id] = $section;
            }
        }
	mysql_free_result($result);
    }
}
?>
